
ifdef OS
	GFX = gdi
else
	GFX = x11
endif

RM = rm -f

.PHONY: all assistant debug lib clean1 clean2

all: lib assistant

assistant:
	@fpc @app.cfg assistant.pas -dRELEASE
	
debug:
	@fpc @app.cfg assistant.pas -dDEBUG
	
lib:
	@fpc @lib.cfg -dRELEASE ../libraries/bgrabitmap/bgrabitmap/bgrabitmap.pas
	@fpc @lib.cfg -dRELEASE ../libraries/bgrabitmap/bgrabitmap/bgragradients.pas
	@fpc @lib.cfg -dRELEASE ../libraries/fpgui/src/corelib/$(GFX)/fpgui_toolkit.pas
	
clean1:
	@$(RM) ./*.compiled
	@$(RM) ./*.lps
	@$(RM) ./*.o
	@$(RM) ./*.or
	@$(RM) ./*.ppu
	@$(RM) ./*.rsj
	
clean2: clean1
	@$(RM) units/i386-linux/*.compiled
	@$(RM) units/i386-linux/*.o
	@$(RM) units/i386-linux/*.or
	@$(RM) units/i386-linux/*.ppu
	@$(RM) units/i386-linux/*.res
	@$(RM) units/i386-linux/*.rsj
	
	@$(RM) units/i386-win32/*.compiled
	@$(RM) units/i386-win32/*.o
	@$(RM) units/i386-win32/*.or
	@$(RM) units/i386-win32/*.ppu
	@$(RM) units/i386-win32/*.res
	@$(RM) units/i386-win32/*.rsj
	
	@$(RM) units/x86_64-linux/*.compiled
	@$(RM) units/x86_64-linux/*.o
	@$(RM) units/x86_64-linux/*.or
	@$(RM) units/x86_64-linux/*.ppu
	@$(RM) units/x86_64-linux/*.res
	@$(RM) units/x86_64-linux/*.rsj
	
	@$(RM) units/x86_64-win64/*.compiled
	@$(RM) units/x86_64-win64/*.o
	@$(RM) units/x86_64-win64/*.or
	@$(RM) units/x86_64-win64/*.ppu
	@$(RM) units/x86_64-win64/*.res
	@$(RM) units/x86_64-win64/*.rsj
